﻿@model HomepageNewsItemsModel

@using Nop.Core.Domain.News

@if (Model.NewsItems.Count > 0)
{
    <section class="news-list-homepage">
        <h2 class="title">
            @T("News")
        </h2>
        <div class="news-items">
            @foreach (var item in Model.NewsItems)
            {
                <article class="news-item">
                    <header class="news-head">
                        <a class="news-title" href="@(await NopUrl.RouteGenericUrlAsync<NewsItem>(new { SeName = item.SeName }))">
                            <h3>@item.Title</h3>
                        </a>
                        <time datetime="@item.CreatedOn.ToString("yyyy-MM-dd")" class="news-date">-@item.CreatedOn.ToString("D")</time>
                    </header>
                    <section class="news-body">
                        @Html.Raw(item.Short)
                    </section>
                    <footer class="buttons">
                        <a href="@(await NopUrl.RouteGenericUrlAsync<NewsItem>(new { SeName = item.SeName }))" class="read-more">@T("News.MoreInfo")</a>
                    </footer>
                </article>
            }
        </div>
        <div class="view-all">
            <a href="@Url.RouteUrl(NopRouteNames.General.NEWS)">@T("News.ViewAll")</a>
        </div>
    </section>

}